import os
from celery import Celery


os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Library_sys.settings")

app = Celery('library_project')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()

app.conf.beat_schedule = {
    'send-due-date-reminders': {
        'task': 'Library_sys.tasks.send_due_date_reminders',
        'schedule': 86400,  # 24 hours
        'options': {'expires': 3600}
    },
}

